package com.example.websocket.service;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;

/**
 * @author wwl
 * @version 1.0
 * @date 2024/8/26 14:30
 * @description:
 */
//@Configuration
//@EnableWebSocket
public class Ws1Config implements WebSocketConfigurer {
    @Override
    public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
        //registry.addHandler(ws1Handler(), "/ws/demo1").setAllowedOrigins("*");
    }

    @Bean
    public Ws1Handler ws1Handler() {
        return new Ws1Handler();
    }
}
